package com.xaicode.learn.java.multithreadarch.ch1;

/**
 * @author Locker cjxia@isoftstone.com
 * @version 1.0
 */
public class TemplateMethod {

    public static void main(String[] args) {
        TemplateMethod t1 = new TemplateMethod() {
            @Override
            protected void wrapPrint(String message) {
                System.out.println("*** " + message);
            }
        };
        t1.wrapPrint("haha");

        TemplateMethod t2 = new TemplateMethod() {
            @Override
            protected void wrapPrint(String message) {
                System.out.println("--- " + message);
            }
        };
        t2.wrapPrint("haha");
    }

    protected void wrapPrint(String message) {

    }

    public final void print(String username) {
        System.out.println("##############");
        wrapPrint(username);
        System.out.println("##############");
    }

}
